package com.mooer.app;

import android.app.Activity;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.Window;
import android.widget.TextView;

import com.mooer.R;
import com.mooer.bean.GlodenManual;
import com.mooer.exception.SVException;
import com.mooer.http.HttpUtils;

/**
 * @author pengfei.xu
 * @version 创建时间：2011-6-21 下午09:05:11 类说明
 */
public class BusinessDynamicMangazine extends Activity {

	private TextView content;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.business_dynamic_mangazine);
		content = (TextView) findViewById(R.id.business_list_name);
		new DynamicMangazineTask().execute("");
	}

	private class DynamicMangazineTask extends
			AsyncTask<String, Integer, GlodenManual> {

		@Override
		protected GlodenManual doInBackground(String... params) {
			GlodenManual glodenManual = null;
			try {
				glodenManual = HttpUtils.fetchLatestGlodenManual("0");
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			return glodenManual;
		}

		@Override
		protected void onPostExecute(GlodenManual result) {
			super.onPostExecute(result);
			content.setText("主要商户：\n" + result.getContent());
		}

	}

}
